const Layout = () => import('@/layout/index.vue')
const Redirect = () => import('@/views/redirect/index.vue')
const NotFound404 = () => import('@/views/inner/404.vue')
const NotFound401 = () => import('@/views/inner/401.vue')
const Login = () => import('@/views/login/index')
/**

 hidden: true // (默认 false)    # 当设置 true 的时候该路由不会在侧边栏出现 如401，login等页面，或者如一些编辑页面/edit/1
 name: 'router-name'                    # 设定路由的名字，一定要填写不然使用<keep-alive>时会出现各种问题

 alwaysShow: true                            # 当你一个路由下面的 children 声明的路由大于1个时，自动会变成嵌套的模式--如组件页面
 # 只有一个时，会将那个子路由当做根路由显示在侧边栏--如引导页面
 # 若你想不管路由下面的 children 声明的个数都显示你的根路由
 # 你可以设置 alwaysShow: true，这样它就会忽略之前定义的规则，一直显示根路由

 meta: {
  title: 'title' 							# 设置该路由在侧边栏和面包屑中展示的名字
  icon: 'svg-name' 						# 设置该路由的图标，支持 svg-class，也支持 el-icon-x element-ui 的 icon
  noCache: true 							# 如果设置为true，则不会被 <keep-alive> 缓存(默认 false)
      noTagsView: true            # 如果设置为true，则不会出现在tag中(默认 false)
  breadcrumb: false  					# 如果设置为false，则不会在breadcrumb面包屑中显示(默认 true)
  affix: true 								# 如果设置为true，则会一直固定在tag项中(默认 false)
  activeMenu: ''							# 显示高亮的路由路径
}
 **/

// 定义静态路由
export const staticRoutes = [{
    path: '/login', hidden: true, component: Login,
}, {
    path: '/redirect', name: 'Redirect', component: Redirect, hidden: true, meta: {noTagsView: true},
}, {
    path: '/404', hidden: true, component: NotFound404,
}, {
    path: '/401', hidden: true, component: NotFound401,
}, {
    path: '/:path(.*)*', redirect: '/404',
},]
// 定义动态路由
export const dynamicRoutes = [{
    path: '/home', component: Layout, redirect: '/home/index.vue', name: 'Home', children: [{
        name: 'Index',
        path: 'index',
        component: () => import('@/views/dashboard/index'),
        meta: {title: '首页', icon: 'el-icon-house', affix: true},
    },],
},
    {
    path: '/sys',
    component: Layout,
    name: 'Sys',
    meta: {
        title: '权限管理',
        icon: 'el-icon-user-solid',
    },
    redirect: '/sys',
    children: [{
        path: 'role',
        component: () => import('@/views/role/index'),
        name: 'Role',
        meta: {title: '角色管理', icon: 'el-icon-user', noCache: true},
    }, {
        path: 'menu',
        component: () => import('@/views/menu/index'),
        name: 'Menu',
        meta: {title: '菜单管理', icon: 'el-icon-user', noCache: true},
    }, {
        path: 'aumenu',
        component: () => import('@/views/aumenu/index'),
        name: 'AuMenu',
        meta: {title: '菜单授权', icon: 'el-icon-user', noCache: true},
    }, {
        path: 'dept',
        component: () => import('@/views/button/index'),
        name: 'Dept',
        meta: {title: '部门管理', icon: 'el-icon-school', noCache: true},
    }, {
        path: 'emp',
        component: () => import('@/views/table/inline-edit-table'),
        name: 'Emp',
        meta: {title: '员工管理', icon: 'el-icon-user', noCache: true},
    },],
},
    {
        path: '/prom',
        component: Layout,
        name: 'ProMan',
        meta: {
            title: '商品赠品管理',
             icon: 'el-icon-user-solid',
        },
        redirect: '/prom/pro',
        children: [{
            path: 'pro',
            component: () => import('@/layout/two/two'),
            name: 'Pro',
            meta: {title: '商品管理', icon: 'el-icon-user', noCache: true},
            children: [{
                    path: 'brand',
                    component: () => import('@/views/brand/index'),
                    name: 'Brand',
                    meta: {title: '品牌管理', icon: 'el-icon-user', noCache: true},
                      },
                  {
                    path: 'goods',
                    component: () => import('@/views/product/index'),
                    name: 'Goods',
                    meta: {title: '产品查询', icon: 'el-icon-user', noCache: true},
                 },
                {
            path: 'category',
            component: () => import('@/views/table/inline-edit-table'),
            name: 'Category',
            meta: {title: '分类管理', icon: 'el-icon-user', noCache: true},
        },
            {
                path: 'factory',
                component: () => import('@/views/table/inline-edit-table'),
                name: 'Factory',
                meta: {title: '供应商管理', icon: 'el-icon-user', noCache: true},
            }

        ]
    },
            {
                path: 'brand',
                component: () => import('@/views/table/inline-edit-table'),
                name: 'Brand',
                meta: {title: '品牌管理', icon: 'el-icon-user', noCache: true},
    }],
},

    {
        path: '/kc',
        component: Layout,
        name: 'KC',
        meta: {
            title: '库存管理',
            icon: 'el-icon-user-solid',
        },
        redirect: '/kc',
        children: [{
            path: 'pro',
            component: () => import('@/layout/two/two'),
            name: 'Pro',
            meta: {title: '商品管理', icon: 'el-icon-user', noCache: true},
            children: [{
                path: 'brand',
                component: () => import('@/views/brand/index'),
                name: 'Brand',
                meta: {title: '品牌管理', icon: 'el-icon-user', noCache: true},
            },
                {
                    path: 'goods',
                    component: () => import('@/views/table/inline-edit-table'),
                    name: 'Goods',
                    meta: {title: '商品管理', icon: 'el-icon-user', noCache: true},
                },
                {
                    path: 'category',
                    component: () => import('@/views/table/inline-edit-table'),
                    name: 'Category',
                    meta: {title: '分类管理', icon: 'el-icon-user', noCache: true},
                },
                {
                    path: 'factory',
                    component: () => import('@/views/table/inline-edit-table'),
                    name: 'Factory',
                    meta: {title: '供应商管理', icon: 'el-icon-user', noCache: true},
                }

            ]
        }, {
            path: 'brand',
            component: () => import('@/views/table/inline-edit-table'),
            name: 'Brand',
            meta: {title: '品牌管理', icon: 'el-icon-user', noCache: true},
        }],
    },
    {
        path: '/sale',
        component: Layout,
        name: 'Sale',
        meta: {
            title: 'B2C销售管理',
            icon: 'el-icon-user-solid',
        },
        redirect: '/prom',
        children: [{
            path: 'pro',
            component: () => import('@/layout/two/two'),
            name: 'Pro',
            meta: {title: '商品管理', icon: 'el-icon-user', noCache: true},
            children: [{
                path: 'brand',
                component: () => import('@/views/brand/index'),
                name: 'Brand',
                meta: {title: '品牌管理', icon: 'el-icon-user', noCache: true},
            },
                {
                    path: 'goods',
                    component: () => import('@/views/table/inline-edit-table'),
                    name: 'Goods',
                    meta: {title: '商品管理', icon: 'el-icon-user', noCache: true},
                },
                {
                    path: 'category',
                    component: () => import('@/views/table/inline-edit-table'),
                    name: 'Category',
                    meta: {title: '分类管理', icon: 'el-icon-user', noCache: true},
                },
                {
                    path: 'factory',
                    component: () => import('@/views/table/inline-edit-table'),
                    name: 'Factory',
                    meta: {title: '供应商管理', icon: 'el-icon-user', noCache: true},
                }

            ]
        }, {
            path: 'brand',
            component: () => import('@/views/table/inline-edit-table'),
            name: 'Brand',
            meta: {title: '品牌管理', icon: 'el-icon-user', noCache: true},
        }],
    },
    {
        path: '/after',
        component: Layout,
        name: 'After',
        meta: {
            title: '售后管理',
            icon: 'el-icon-user-solid',
        },
        redirect: '/prom',
        children: [{
            path: 'pro',
            component: () => import('@/layout/two/two'),
            name: 'Pro',
            meta: {title: '商品管理', icon: 'el-icon-user', noCache: true},
            children: [{
                path: 'brand',
                component: () => import('@/views/brand/index'),
                name: 'Brand',
                meta: {title: '品牌管理', icon: 'el-icon-user', noCache: true},
            },
                {
                    path: 'goods',
                    component: () => import('@/views/table/inline-edit-table'),
                    name: 'Goods',
                    meta: {title: '商品管理', icon: 'el-icon-user', noCache: true},
                },
                {
                    path: 'category',
                    component: () => import('@/views/table/inline-edit-table'),
                    name: 'Category',
                    meta: {title: '分类管理', icon: 'el-icon-user', noCache: true},
                },
                {
                    path: 'factory',
                    component: () => import('@/views/table/inline-edit-table'),
                    name: 'Factory',
                    meta: {title: '供应商管理', icon: 'el-icon-user', noCache: true},
                }

            ]
        }, {
            path: 'brand',
            component: () => import('@/views/table/inline-edit-table'),
            name: 'Brand',
            meta: {title: '品牌管理', icon: 'el-icon-user', noCache: true},
        }],
    }



]

// 动态重定向
export const dynamicRedirect = {
    path: '/', hidden: true, redirect: '/home/index.vue',
}
